using System;
using System.Collections.Generic;
using System.Text;

namespace EntLibContrib.Validation.Tests
{
    public class TestTargetWithAttribute
    {
        private Foo foo1 = new Foo();
        private Foo foo2 = new Foo();

        [ExternallyConfiguredObjectValidator("FooRules1", "FooValidation.config")]
        public Foo ValidateMeUsingFooRules1
        {
            get { return foo1; }
        }


        [ExternallyConfiguredObjectValidator("FooRules2", "FooValidation.config")]
        public Foo ValidateMeUsingFooRules2
        {
            get { return foo2; }
        }
    }

    public class TestTargetWithConfig
    {

        private Foo foo1 = new Foo();
        private Foo foo2 = new Foo();

        // in config -> [ExternallyConfiguredObjectValidator("FooRules1", "FooValidation.config")]
        public Foo ValidateMeUsingFooRules1
        {
            get { return foo1; }
        }


        // in config -> [ExternallyConfiguredObjectValidator("FooRules2", "FooValidation.config")]
        public Foo ValidateMeUsingFooRules2
        {
            get { return foo2; }
        }
    }

    public class Foo
    {
        private string value;

        //Validation in configuration:
        //FooRules1 -> NotNullValidator
        //FooRules2 -> NotNullValidator negated
        public string Value
        {
            get { return value; }
            set { this.value = value; }
        }
    }
}
